<!DOCTYPE HTML>
<html lang="en">
<head>
<title>EnvUpdate - Syntax &amp; Usage | AutoHotkey</title>
<meta name="description" content="The EnvUpdate command notifies the OS and all running applications that environment variable(s) have changed." />
<meta name="ahk:equiv-v2" content="AutoHotkey.htm" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
</head>
<body>

<h1>EnvUpdate</h1>

<p>Notifies the OS and all running applications that <a href="../Concepts.htm#environment-variables">environment variable(s)</a> have changed.</p>

<pre class="Syntax"><span class="func">EnvUpdate</span></pre>
<h2>Error Handling</h2>
<p><span class="ver">[v1.1.04+]</span>: This command is able to throw an exception on failure. For more information, see <a href="Catch.htm#RuntimeErrors">Runtime Errors</a>.</p>
<p><a href="../misc/ErrorLevel.htm">ErrorLevel</a> is set to 1 if there was a problem or 0 otherwise.</p>
<h2>Remarks</h2>
<p>Refreshes the OS environment. Similar effect as logging off and then on again.</p>
<p>For example, after making changes to the following registry key, EnvUpdate could be used to broadcast the change: <pre>HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment</pre></p>
<h2>Related</h2>
<p><a href="EnvSet.htm">EnvSet</a>, <a href="RegWrite.htm">RegWrite</a></p>
<h2>Examples</h2>
<div class="ex" id="ExBasic">
<p><a href="#ExBasic">#1</a></p>
<pre>EnvUpdate</pre>
</div>

</body>
</html>
